<template>
	<view class="page">
		<cu-custom bgColor="bg-gradual-red" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{title}}</block>
		</cu-custom>

		<Loading class="loading" v-show="!isLoading" :isStatus='loadStatus'></Loading>
		<scroll-view scroll-y="true">
			<view v-html="showData"></view>
		</scroll-view>

	</view>
</template>

<script>
	export default {
		

		data() {
			return {
				title:"",
				showData: "",
				type: "",
				isLoading: false,
				loadStatus: 'load',

			}
		},
		onLoad(option) {
			this.type = option.type;
			
			(option.type == 0 ? this.loadLocal(option) : this.loadData());

		},
		onShareAppMessage(res) {
			return {
				title: "乐知课程艺术中心",
				imageUrl: this.Reques.resDomain + "yishu.png",
				path: '/pages/index/index?userCode=' + this.initCode
			}
		
		},
		methods: {
			loadLocal(dat) {
				console.log("加载本地数据");
				this.isLoading = true;
				this.title="红包规则说明";
				this.showData = dat.data;
			},
			loadData() {
			
		
				this.Reques.commonQuest("xcx/message.api.php", "POST", {action:'getPolicy'}).then((res) => {
					console.log(res);
					this.showData = res.data[this.type];
					this.isLoading = true;
				}, (err) => {
					this.loadStatus = 'error2';;
					uni.showModal({
						title: "提示",
						content: "网络错误"
					})

				})
			}



		}



	}
</script>

<style>
</style>
